<script setup>

import PageMain from "@/components/PageMain.vue";
import {ref} from "vue";
import {http} from "@/api";
const searchParams = ref({
  nickname: '',
  type: 1
})
const userList = ref([])
const search = () => {
  http.user.list(searchParams.value).then(res => {
    userList.value = res.data
  })
}
const reset = () => {
  searchParams.value = {
    nickname: '',
    type: 1
  }
  search()
}
search()
</script>

<template>
  <PageMain title="律师咨询">
    <el-form label-suffix="：" inline>
      <el-form-item label="昵称">
        <el-input v-model="searchParams.nickname" placeholder="请输入"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="search">查询</el-button>
        <el-button @click="reset">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="20">
      <el-col :span="6" v-for="item in userList" :key="item.id">
        <el-card style="max-width: 480px">
          <template #header>{{ item.nickname }}-{{ item.phone}}</template>
          <img
              :src="item.image"
              style="width: 100%"
          />
        </el-card>
      </el-col>
    </el-row>
  </PageMain>
</template>

<style scoped lang="scss">

</style>